/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.company.management.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Paner
 */
@Entity
@Table(name = "company", catalog = "cafedb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Company.findAll", query = "SELECT c FROM Company c"),
    @NamedQuery(name = "Company.findById", query = "SELECT c FROM Company c WHERE c.id = :id"),
    @NamedQuery(name = "Company.findByName", query = "SELECT c FROM Company c WHERE c.name = :name"),
    @NamedQuery(name = "Company.findByLocation", query = "SELECT c FROM Company c WHERE c.location = :location"),
    @NamedQuery(name = "Company.findBySchedule", query = "SELECT c FROM Company c WHERE c.schedule = :schedule"),
    @NamedQuery(name = "Company.findByTotalmoneyspend", query = "SELECT c FROM Company c WHERE c.totalmoneyspend = :totalmoneyspend")})
public class Company implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "NAME", nullable = false, length = 255)
    private String name;
    @Basic(optional = false)
    @Column(name = "LOCATION", nullable = false, length = 255)
    private String location;
    @Basic(optional = false)
    @Column(name = "SCHEDULE", nullable = false)
    @Temporal(TemporalType.TIME)
    private Date schedule;
    @Basic(optional = false)
    @Column(name = "TOTALMONEYSPEND", nullable = false)
    private float totalmoneyspend;

    public Company() {
    }

    public Company(Integer id) {
        this.id = id;
    }

    public Company(Integer id, String name, String location, Date schedule, float totalmoneyspend) {
        this.id = id;
        this.name = name;
        this.location = location;
        this.schedule = schedule;
        this.totalmoneyspend = totalmoneyspend;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Date getSchedule() {
        return schedule;
    }

    public void setSchedule(Date schedule) {
        this.schedule = schedule;
    }

    public float getTotalmoneyspend() {
        return totalmoneyspend;
    }

    public void setTotalmoneyspend(float totalmoneyspend) {
        this.totalmoneyspend = totalmoneyspend;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Company)) {
            return false;
        }
        Company other = (Company) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.company.management.Company[ id=" + id + " ]";
    }
    
}
